package com.jqb.ant.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.jqb.ant.dao.UserDao;
import com.jqb.ant.service.UserService;
import com.jqb.ant.vo.User;

/**
 * @author Dong
 */
@Service("userService")
public class UserServiceImpl implements UserService {
	@Resource
	private UserDao userDao;
	
	public void setUserDao(UserDao userDao) {
		this.userDao = userDao;
	}

	/* (non-Javadoc)
	 * @see com.jqb.ant.service.UserService#addUser(com.jqb.ant.vo.User)
	 */
	@Override
	public void addUser(User user) {
		userDao.addUser(user);
	}

	/* (non-Javadoc)
	 * @see com.jqb.ant.service.UserService#deleteUser(int)
	 */
	@Override
	public void deleteUser(int id) {
		userDao.deleteUser(id);
	}

	/* (non-Javadoc)
	 * @see com.jqb.ant.service.UserService#updateUser(com.jqb.ant.vo.User)
	 */
	@Override
	public void updateUser(User user) {
		userDao.updateUser(user);
	}

	/* (non-Javadoc)
	 * @see com.jqb.ant.service.UserService#getUserById(int)
	 */
	@Override
	public User getUserById(int id) {
		User user = userDao.getUserById(id);
		return user;
	}

	/* (non-Javadoc)
	 * @see com.jqb.ant.service.UserService#getUserByName(java.lang.String)
	 */
	@Override
	public User getUserByName(String name) {
		User user = userDao.getUserByName(name);
		return user;
	}

	/* (non-Javadoc)
	 * @see com.jqb.ant.service.UserService#getUsers()
	 */
	@Override
	public List<User> getUsers() {
		List<User> users = userDao.getUsers();
		return users;
	}

}
